home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 1 #10
/
uv1n10s1.d64
/
binary saver
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
5KB
|
172 lines
10 rem binary saver v3.0
20 rem designed by brandon corfman
30 rem
40 rem * initialization *
45 if a=0 then a=1:load"dir.obj",8,1
50 poke 650,0:hx$="0123456789abcdef":s=54272:fori=0to15:pokes+24,i:next
55 poke 53281,11:poke 53280,0
60 rem * main menu *
70 print"[158][147] [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
80 printtab(5)"[221] [194]inary [211]aver v3.0 [221]"
90 printtab(5)"[221][196]esigned by [194]randon [195]orfman[221]"
100 printtab(5)"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
110 print"[159] [198]1 [146] - [211]ound : ";:if sf=1 then print "[158][207]n[159]":goto130
120 print "[158][207]ff[159]"
130 print" [198]3 [146] - [206]umbers : ";:if nf=1 then print "[158][200]ex[159]":goto150
140 print "[158][196]ecimal[159]"
150 print" [198]5 [146] - [195]opies : ";:if cf=1 then print "[158][205]ultiple[159]":goto170
160 print "[158][207]ne[159]"
170 print" [198]7 [146] - [211]ave [205]emory [194]lock"
180 print" [198]2 [146] - [211]end [196]isk [195]ommand"
190 print" [198]8 [146] - [209]uit to [213]p[212]ime[158]"
195 print"[152] [208]ublished by [211]oftdisk [208]ublishing, [201]nc.[158]";
200 getz$:ifz$=""then200
210 ifz$="[133]"then290
220 ifz$="[137]"then1450
230 ifz$="[134]"then320
240 ifz$="[135]"then350
250 ifz$="[136]"then380
260 ifz$="[140]"then1560
270 goto200
280 rem * change sound flag *
290 sf=1-sf:ifsf=1thenprint""spc(19)"[207]n ":goto200
300 print""spc(19)"[207]ff":goto200
310 rem * change number flag *
320 nf=1-nf:ifnf=1thenprint""spc(19)"[200]ex ":goto200
330 print""spc(19)"[196]ecimal":goto200
340 rem * change copy flag *
350 cf=1-cf:ifcf=1thenprint""spc(19)"[205]ultiple":goto200
360 print""spc(19)"[207]ne ":goto200
370 rem * ask parameters for save *
380 print"[147][198]ilename: [159]";:l=16:gosub730:fi$=in$
385 if fi$="" then 60
390 print"[158] [211]tarting address: [157][157][157][157][157][159]";
400 ifnf=1thenl=4:gosub970:sa=a:goto420
410 l=5:gosub850:sa=val(in$)
420 ifsa>65534thenprinttab(9)"[150][201]nvalid starting address[145][145][145][145]":goto390
430 print"[158][197]nding address + 1: [157][157][157][157][157][157][157][157][157][157][157][157][157][159]";
440 ifnf=1thenl=4:gosub970:ea=a:goto460
450 l=5:gosub850:ea=val(in$)
460 ifea>65535orea<=sathenprinttab(9)"[150][201]nvalid ending address[145][145][145][145]":goto430
465 printtab(9)" "
470 printtab(6)"[201]nsert save disk into drive"
480 print" [211]pace [146] [159]to continue, [198]1 [146] [159]to abort"
490 getz$:ifz$<>" "andz$<>"[133]"then490
500 ifz$="[133]"then 60
510 rem * save program *
520 print"[147]"tab(12)"[215]riting file ..."
525 printtab(11)"[207]ne moment, please"
530 sys57812fi$,8,1
540 poke193,sa-256*int(sa/256):poke194,int(sa/256)
550 poke174,ea-256*int(ea/256):poke175,int(ea/256)
560 sys62957
570 gosub1120
580 ifsc=1thensc=0:goto520
590 ifcf=1then670
600 rem * single copy option *
610 printtab(13)"[208]rogram saved!"
620 printtab(9)"[158][193]nother program? ([217]/[206])"
630 getz$:ifz$<>"y"andz$<>"n"thengosub1330:goto630
640 ifz$="y"then70
650 goto60
660 rem * multiple copy option *
670 printtab(7)"[201]nsert disk for next copy"
680 print" [211]pace [146][159] to continue, [198]1[146] [159]to abort"
690 getz$:ifz$<>" "andz$<>"[133]"thengosub1330:goto690
700 ifz$="[133]"thensf=.:goto620
710 goto520
720 rem * string input *
730 in$=""
740 print"[166]";
750 getz$:ifz$=""then750
755 if z$=chr$(34) then 750
760 ifz$=chr$(13)thenprint"[157] ":return
770 iflen(in$)=lthen820
780 ifasc(z$)=20andlen(in$)>0thenin$=left$(in$,len(in$)-1):goto810
790 ifnot(z$>=" "andz$<="z")then750
800 in$=in$+z$
810 print"[157]"z$;:goto740
820 ifasc(z$)<>20then750
830 in$=left$(in$,len(in$)-1):goto810
840 rem * decimal input *
850 in$=""
860 print"[166]";
870 getz$:ifz$=""then870
880 ifz$=chr$(13)thenprint"[157] ":return
890 iflen(in$)=lthen940
900 ifasc(z$)=20andlen(in$)>0thenin$=left$(in$,len(in$)-1):goto930
910 ifnot(z$>="0"andz$<="9")then870
920 in$=in$+z$
930 print"[157]"z$;:goto860
940 ifasc(z$)<>20then870
950 in$=left$(in$,len(in$)-1):goto930
960 rem * hex input *
970 in$=""
980 print"[166]";
990 getz$:ifz$=""then990
1000 ifz$=chr$(13)andlen(in$)=4thenprint"[157] ":goto1080
1010 iflen(in$)=lthen1060
1020 ifasc(z$)=20andlen(in$)>0thenin$=left$(in$,len(in$)-1):goto1050
1030 ifnot(z$>="0"andz$<="9")andnot(z$>="a"andz$<="f")then990
1040 in$=in$+z$
1050 print"[157]"z$;:goto980
1060 ifasc(z$)<>20then990
1070 in$=left$(in$,len(in$)-1):goto1050
1080 a=.:fori=1to4
1090 l%=asc(mid$(in$,i,1)):l%=l%-48+(l%>64)*7:a=16*a+l%:next
1100 return
1110 rem * error checker *
1120 open1,8,15
1130 input#1,en,em$,et,es:close1
1140 ifen<>0then1160
1150 return
1160 ifen=63then1200
1170 ifen=74then1260
1180 gosub1390:print"[196]isk error!"
1190 print""en;em$;et;es:end
1200 print"[196]isk error! [198]ile exists!"
1210 print"[210][146]eplace or [193][146]bort?"
1220 getz$:ifz$<>"r"andz$<>"a"thengosub1390:goto1220
1230 ifz$="a"then1560
1240 print"[210]eplacing file ...":open1,8,15,"s0:"+fi$:close1
1250 sc=1:return
1260 print"[196]isk error! [196]rive not ready!"
1270 print"[210][146]etry or [193][146]bort?"
1280 getz$:ifz$<>"r"andz$<>"a"thengosub1390:goto1280
1290 ifz$="a"then1560
1300 open1,8,15,"u;":close1
1310 sc=1:return
1320 rem * bell sound *
1330 ifsf=.thenreturn
1340 pokes+1,40:pokes+5,9:pokes+6,9:pokes+4,33
1350 fori=1to40:next
1360 pokes+4,32:fori=1to400:next
1370 return
1380 rem * error sound *
1390 ifsf=.thenreturn
1400 pokes+1,10:pokes+5,9:pokes+6,9:pokes+4,33
1410 fori=1to40:next
1420 pokes+4,32:fori=1to400:next
1430 return
1440 rem * send disk command *
1450 print"[195]ommand: ";:l=29:gosub730
1460 open1,8,15
1465 if in$="" then 1490
1467 if in$="$" then print"[147][159]":sys 49152:goto 1490
1470 print#1,in$
1490 printtab(5)"[158]";
1500 get#1,a$:printa$;:if a$<>chr$(13) then 1500
1505 close 1
1510 print" [159][208]ress [210]eturn [146][159] to continue ";
1520 getz$:ifz$<>chr$(13)anden=.thengosub1330:goto1520
1530 ifz$<>chr$(13)anden>0thengosub1390:goto1520
1540 goto70
1550 rem * end program *
1560 print"";:printtab(11)"[193]re you sure ([217]/[206])"
1570 get a$:if a$="n" then printtab(11)"[145] ":goto 200
1580 if a$<>"y" then 1570
1590 a=0:for i=32768 to 32775
1600 a=a+peek(i):next
1610 if a<>859 then print"[147]":end
1700 sys 8*4096+4